package com.joven.shelltest.config;

import com.joven.shelltest.interceptor.SignInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @Author wzj
 * @Date 2023-11-23 09:01
 **/
@Configuration
public class SignInterceptorConfig implements WebMvcConfigurer {

    @Autowired
    private SignInterceptor signInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //只拦截openapi前缀的接口
        registry.addInterceptor(signInterceptor)
                .addPathPatterns("/openapi/**");
    }
}
